using System.Collections;
using System.Collections.Generic;
using Survivor;
using UnityEngine;

public class DamageSystem
{
    public static (int,bool) CalculateDamage(int baseDamage, float maxNormalDamage = 1.5f, float maxCriticalDamageTimes = 3)
    {
        int finalDamage = 0;
        bool isCritical = false;
        finalDamage = Mathf.RoundToInt(Random.Range(0.8f, maxNormalDamage) * baseDamage * Global.DamageRate.Value);
        if (Random.value <= Global.CriticalRate.Value)
        {
            isCritical = true;
            finalDamage = Mathf.RoundToInt(finalDamage*maxCriticalDamageTimes);
        }
        return (finalDamage,isCritical);
    }
}
